#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Script to generate fake data for the simpleBlog application.
"""

import os
import sys

# Add the parent directory to the Python path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))

from simpleBlog import create_app
from simpleBlog.extensions import db

def forge_data():
    """Generate fake data."""
    app = create_app('development')
    with app.app_context():
        # Import the fake data functions
        from simpleBlog.fakes import fake_admin, fake_categories, fake_posts, fake_comments, fake_links
        
        db.drop_all()
        db.create_all()

        print('Generating the administrator...')
        fake_admin()

        print('Generating 10 categories...')
        fake_categories(10)

        print('Generating 50 posts...')
        fake_posts(50)

        print('Generating 500 comments...')
        fake_comments(500)

        fake_links()

        print('Done.')

if __name__ == '__main__':
    forge_data()